const Router = require('koa-router')

const router = new Router({ prefix: '/article' })

const service = require('../service/article_service')

router.get('/getarticledetail', async (ctx, next) => {
  const query = ctx.request.query.articleId
  if (query) {
    const result = await service.getArticleDetail(query)
    ctx.status = 200
    ctx.body = result[0]
  } else {
    ctx.status = 404
  }

})

module.exports = router